package com.dimples.dd.system.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dimples.dd.tenant.core.dataobject.TenantBaseDO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 系统访问记录
 */
@Schema(description = "系统访问记录")
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "system_login_log")
public class SystemLoginLogDO extends TenantBaseDO {
    /**
     * 访问ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "访问ID")
    private Long id;

    /**
     * 日志类型
     */
    @TableField(value = "log_type")
    @Schema(description = "日志类型")
    private Integer logType;

    /**
     * 链路追踪编号
     */
    @TableField(value = "trace_id")
    @Schema(description = "链路追踪编号")
    private String traceId;

    /**
     * 用户编号
     */
    @TableField(value = "user_id")
    @Schema(description = "用户编号")
    private Long userId;

    /**
     * 用户类型
     */
    @TableField(value = "user_type")
    @Schema(description = "用户类型")
    private Byte userType;

    /**
     * 用户账号
     */
    @TableField(value = "username")
    @Schema(description = "用户账号")
    private String username;

    /**
     * 登陆结果
     */
    @TableField(value = "`result`")
    @Schema(description = "登陆结果")
    private Byte result;

    /**
     * 用户 IP
     */
    @TableField(value = "user_ip")
    @Schema(description = "用户 IP")
    private String userIp;

    /** 登录地点 */
    @TableField(value = "login_location")
    @Schema(description = "登录地点")
    private String loginLocation;

    /**
     * 浏览器 UA
     */
    @TableField(value = "browser")
    @Schema(description = "浏览器 UA")
    private String browser;

    /**
     * 操作系统
     */
    @TableField(value = "os")
    @Schema(description = "操作系统")
    private String os;
}